import React from 'react';

import render from 'src/hrpub/common/frame/render';
import './components/Refer/refer.less';
import './index.less';
import {connect} from 'src/hrpub/common/store';
import {COMMON} from "../../unit/util";
import TotalDetail from "./components/Total";
import EntryDetail from "./components/Entry";
import DimissionDetail from "./components/Dimission";
import ChangeDetail from "./components/Change";
import RegDetail from "./components/Reg";
import AgeeduDetail from "./components/Ageedu";
import EntrydimiDetail from "./components/Entrydimission";
import RankstructureDetail from "./components/Rankstructure";
import StaffchangeDetail from "./components/Staffchange";
import Subdetail from "./components/Subdetail";

const DetailPage = render()(({props, action, state}) => {
    let {staffCom} = props;
    return (
        <div className={'detail-page'}>
            <Choose>
                {/*总人数*/}
                <When condition={staffCom.page === COMMON.pageTotal}>
                    <TotalDetail
                        {...props}
                    />
                </When>
                {/*本月已入职*/}
                <When condition={staffCom.page === COMMON.pageEntry}>
                    <EntryDetail
                        {...props}
                    />
                </When>
                {/*本月已离职*/}
                <When condition={staffCom.page === COMMON.pageDimission}>
                    <DimissionDetail
                        {...props}
                    />
                </When>
                {/*本月变动*/}
                <When condition={staffCom.page === COMMON.pageChange}>
                    <ChangeDetail
                        {...props}
                    />
                </When>
                {/*待转正人数*/}
                <When condition={staffCom.page === COMMON.pageReg}>
                    <RegDetail
                        {...props}
                    />
                </When>
                {/*年龄与学历结构*/}
                <When condition={staffCom.page === COMMON.pageAgeEdu}>
                    <AgeeduDetail
                        {...props}
                    />
                </When>
                {/*入离职趋势*/}
                <When condition={staffCom.page === COMMON.pageEntryDimission}>
                    <EntrydimiDetail
                        {...props}
                    />
                </When>
                {/*职级结构*/}
                <When condition={staffCom.page === COMMON.pageRankStr}>
                    <RankstructureDetail
                        {...props}
                    />
                </When>
                {/*人员变动分析*/}
                <When condition={staffCom.page === COMMON.pageStaffChange}>
                    <StaffchangeDetail
                        {...props}
                    />
                </When>
                {/*穿透后详情页*/}
                <When condition={staffCom.page === COMMON.pageSubdetail}>
                    <Subdetail
                        {...props}
                    />
                </When>
            </Choose>
        </div>
    );

});

export default connect(DetailPage);